package com.weixing.mall.provider.support.excaldata;

import cn.hutool.core.util.ObjectUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.weixing.mall.base.constant.GlobalConstant;
import com.weixing.mall.util.CommUtil;
import lombok.Data;

import java.net.URL;

/**
 * @Author 0202
 * @Date 2020年8月24日
 * @Version 1.0
 **/
@Data
@ContentRowHeight(100)
public class ProductStockListED {

    @ExcelProperty("序号")
    private Long id;

    @ExcelProperty("货号")
    private String goodsSn;
    @ExcelProperty("款号")
    private  String styleNo;

    @ExcelProperty("图片")
    @ExcelIgnore
    private String productImg;
    @ExcelProperty("图片")
    private URL img;

    public void setProductImg(String productImg){
        this.productImg = productImg;
        if(ObjectUtil.isNotEmpty(productImg)){
            try {
                this.img = new URL(GlobalConstant.IMG_PATH_URL+productImg+GlobalConstant.IMG_PATH_URL_SUFFIX);
            }catch (Exception e){
                e.printStackTrace();
            }
           // if(CommUtil.checkUrl(GlobalConstant.IMG_PATH_URL+productImg+GlobalConstant.IMG_PATH_URL_SUFFIX)){ }
        }
    }

    @ExcelProperty("库位")
    private String storehouse;
    @ExcelProperty("商品名称")
    private String goodsName;

    @ExcelProperty("颜色尺码")
    @ExcelIgnore
    private String productSkuDesp;

    @ExcelProperty("颜色")
    private String color;
    @ExcelProperty("尺码")
    private String size;

    @ExcelProperty("吊牌价")
    private String marketPrice;
    @ExcelProperty("数量")
    private Integer stock;
    //吊牌总额金额
    @ExcelProperty("吊牌价总金额")
    private String marketPriceTotal;
    //库存价(成本价)
    @ExcelProperty("库存价")
    private String depotPrice;
    @ExcelProperty("所属仓库名称")
    private String depotName;
    @ExcelProperty("库存编码")
    private String depotSnStr;

}
